package com.atguigu.gmall.task.test;

import com.atguigu.gmall.common.constant.MqConst;
import com.atguigu.gmall.common.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/9/8 14:43
 * @Version 1.0
 */
//@EnableScheduling
//@Component
//public class ScheduledTask {
//
//    @Autowired
//    private RabbitService rabbitService;
//
//    @Scheduled(cron = "0/5 * * * * ?")
//    public void test(){
//        //  System.out.println("定时任务测试......"); 发送消息内容是由消费者决定. 查询当天要秒杀的商品放入缓存.
//        rabbitService.sendMsg(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_1,"啥都行...");
//    }
//
//    @Scheduled(cron = "0/10 * * * * ?")
//    public void clearData(){
//        //  System.out.println("定时任务测试......"); 发送消息内容是由消费者决定. 查询当天要秒杀的商品放入缓存.
//        rabbitService.sendMsg(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_18,"清空缓存数据...");
//    }
//}
